class Solution {
    public String modifyString(String s) {
        char[] ret = s.toCharArray();
        int n = ret.length;
        for(int i = 0;i < n;i++) {
            if(ret[i] == '?') {
                for(char ch = 'a';ch <= 'z';ch++) {
                    if((i == 0 || ret[i - 1] != ch) && (i == n - 1 || ret[i + 1] != ch)) {
                        ret[i] = ch;
                        break;
                    }
                }
            }
        }
        return String.valueOf(ret);
    }
}